<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="https://cdn.staticfile.org/axios/0.19.0-beta.1/axios.js"></script>
  <script src="https://cdn.staticfile.org/vue/2.5.17/vue.js"></script>
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.13.0/theme-chalk/index.css" />
  <script src="https://cdn.staticfile.org/element-ui/2.13.0/index.js"></script>
  <link rel="stylesheet" href="https://cdn.staticfile.org/animate.css/3.7.0/animate.min.css" />
  <link rel="stylesheet" href="../../../lib/index.css" />
  <script src="../../../lib/avue.js"></script>
</head>

<body>
  <div id="app">
    <avue-crud :option="option" :data="data"></avue-crud>
  </div>
</body>
<script>
  var validateUsername = (rule, value, callback) => {
    console.log('========');
    callback();
  };
  new Vue({
    el: '#app',
    data() {
      return {
        form: {},
        data: [],
        option: {
          indexLabel: '序号',
          searchSize: 'small',
          menuAlign: 'center',
          align: 'center',
          index: true,
          border: true,
          stripe: true,
          arrow: false,
          viewBtn: true,
          delBtn: false,
          editBtn: false,
          searchMenuSpan: 4,
          column: [{
            fixed: true,
            label: '用户编号',
            prop: 'userId',
            span: 24,
            hide: true,
            addDisplay: false,
            editDisabled: true,
            showColumn: false,
          }, {
            fixed: true,
            label: '用户名',
            prop: 'username',
            span: 24,
            search: true,
            editDisabled: true,
            rules: [
              {
                validator: validateUsername,
                trigger: 'blur'
              },
            ],
          }, {
            label: '密码',
            prop: 'password',
            type: 'password',
            value: '',
            span: 24,
            hide: true,
            showColumn: false,
          }, {
            label: '所属部门',
            prop: 'deptId',
            span: 24,
            hide: true,
            showColumn: false,
            dataType: 'number',
          }, {
            label: '手机号',
            prop: 'phone',
            value: '',
            span: 24,
          }, {
            label: '角色',
            prop: 'role',
            overHidden: true,
            span: 24,
          }, {
            label: '状态',
            prop: 'lockFlag',
            type: 'radio',
            border: true,
            span: 24,
            dicData: [{
              label: '有效',
              value: '0',
            }, {
              label: '锁定',
              value: '9',
            }],
          }, {
            width: 180,
            label: '创建时间',
            prop: 'createTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            valueFormat: 'yyyy-MM-dd HH:mm:ss',
            editDisabled: true,
            addDisplay: false,
            span: 24,
          }],
        }
      }
    }
  })
</script>

</html>